package com.example.abstractFactoryPattern.color;

import com.example.abstractFactoryPattern.AbstractFactory;
import com.example.abstractFactoryPattern.shape.Shape;
import com.example.abstractFactoryPattern.shape.ShapeType;

import java.util.Objects;

/**
 * 颜色工厂
 * sun 2017-11-23
 */
public abstract class ColorFactory extends AbstractFactory {
    public Color getColor(ColorType colorType) {
        if (Objects.isNull(colorType)) return null;
        switch (colorType) {
            case RED:
                return new Red();
            case BLUE:
                return new Blue();
            case GREEN:
                return new Green();
            default:
                return null;
        }
    }

    public Shape getShape(ShapeType shapeType) {
        return null;
    }
}
